<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AngularJS TEST day5</title>
</head>
<body>
	<div ng-app="" ng-controller="customerController">
		<ul>
			<li ng-repeat="x in names">
				{{ x.Name + ', ' + x.Country }}
			</li>
		</ul>
	</div>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
	<script type="text/javascript">
	
	// $http is a service for reading data from web servers.
	// $http.get( url ) is the function to use for reading server data.
	function customerController($scope, $http){
		$http.get("http://www.w3schools.com/website/Customers_JSON.php")
		.success(function(response){
			$scope.names = response;	// $scope.names becomes an array, when loaded with the JSON data from the server.
		});
	}
	</script>
</body>
</html>